﻿@model Tippelde.Services.Dtos.EventWithBetData
@if (Model.IsUserEditor)
{
    <div id="result-admin-container-@Model.Id">
        @if (Model.HasResult)
        {
            using (Html.BeginForm("ResultDelete", "Event", FormMethod.Post, new { @class = "form-container event-form form-result-admin form-ajax-confirm" }))
            {
                @Html.ValidationSummary();
            @Html.AntiForgeryToken();
            @Html.HiddenFor(m => m.Id);
            <span>Eredmény:</span>
            <span>@Model.Result.HomeResult</span>
            <span> - </span>
            <span>@Model.Result.AwayResult</span>
            <button type="submit" class="btn btn-xs btn-info pull-right">
                <span class="glyphicon glyphicon-remove"></span>
                Törlöm
            </button>
            }
        }
        else
        {
            if (Model.EventDate < DateTime.Now)
            {
                using (Html.BeginForm("ResultAdd", "Event", FormMethod.Post, new { @class = "form-container event-form  form-result-admin form-event-add" }))
                {
                    @Html.ValidationSummary()
                    <div class="input-group input-group-sm input-group-bet">
                        @Html.AntiForgeryToken()
                        @Html.HiddenFor(m => m.Id)
                        <span class="input-group-addon">Eredmény:</span>
                        @Html.TextBoxFor(m => m.Result.HomeResult, new { @class = "form-control", @type = "number" })
                        <span class="input-group-addon"> - </span>
                        @Html.TextBoxFor(m => m.Result.AwayResult, new { @class = "form-control", @type = "number" })
                        <span class="input-group-btn">
                            <button type="submit" class="btn btn-default">
                                <span class="glyphicon glyphicon-ok"></span>
                            </button>
                        </span>
                    </div>
                }
            }
        }
    </div>
}